package Demo08.Demo0825;
//这一部分是给类和对象准备的
public class Prepare {
    public static void main1(String[] args) {
        //类的实例化
        PetDog dogh = new PetDog();  //通过new 实例化对象
        dogh.name = "阿黄";
        dogh.color = "黑黄";
        dogh.barks();
        dogh.wag();

        PetDog dogs = new PetDog();
        dogs.name = "赛虎";
        dogs.color = "棕色";
        dogs.barks();
        dogs.wag();
    }

    public static void main(String[] args) {

    }
}

//定义一个狗类
class PetDog{
    //狗类的成员变量
    public String name;
    public String color;

    //狗的属性，狗的成员方法
    public void barks(){
        System.out.println(name + ":汪汪汪~~~");
    }

    public void wag(){
        System.out.println(name + ":摇尾巴~~~");
    }
}

